package com.common.base;


import com.common.util.LogUtil;

/**
 * viewpager一起用
 * Created by abel on 16/12/15.
 */

public abstract class BasePageFragment extends BaseFragment {

    private boolean isResume;
    private boolean isVisible;

    @Override
    public void onResume() {
        super.onResume();
        isResume = true;
        if (isVisible) {
            onResumeVisible();
        }
    }

    @Override
    public void onPause() {
        super.onPause();
        isResume = false;
    }

    @Override
    public void setUserVisibleHint(boolean isVisibleToUser) {
        super.setUserVisibleHint(isVisibleToUser);
        isVisible = isVisibleToUser;
        if (isVisibleToUser && isResume) {
            onResumeVisible();
        }
    }

    public void onResumeVisible() {
        LogUtil.d(this + "onResumeVisible");
    }
}
